BotCom Relay API
================

Minimal PHP + MySQL relay that lets a static BotCom-built site on BlueHost
exchange form submissions, bookings, and availability with a BotCom instance
running on the owner's laptop.

Files
-----
  submit.php          public  POST  accepts contact + booking submissions
  available-slots.php public  GET   returns published bookable slots as JSON
  pull.php            private GET   BotCom pulls new inbox rows (token-auth)
  ack.php             private POST  BotCom acknowledges rows as processed
  push-slots.php      private POST  BotCom publishes current availability
  schema.sql                        one-time MySQL table setup
  config.example.php                copy to config.php and fill in

Install
-------
1. Upload this _api/ folder to public_html/api/ on BlueHost via SFTP.
2. In cPanel → MySQL Databases, create a DB + user, grant ALL PRIVILEGES.
3. In phpMyAdmin, import schema.sql into that DB.
4. Copy config.example.php to config.php, fill in DB credentials and the
   shared secret (BotCom will generate one per site — keep them in sync).
5. Make sure config.php is NOT web-readable: place it outside public_html or
   rely on the included .htaccess (shipped alongside) which denies direct
   access to config.php.

Security
--------
- Shared-secret token required on pull/ack/push endpoints. Rotated per site.
- Basic rate limiting on submit.php (IP-based, 30 req / 10 min).
- Input length caps + honeypot field check.
- Outbound prepared statements only (PDO).
